package com.wuchao.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuchao.entity.Vehicle;
import com.wuchao.response.Result;
import com.wuchao.service.VehicleService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;


import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wuchao
 * @since 2022-08-04
 */
@RestController
@CrossOrigin
public class VehicleController {
    @Resource
    VehicleService vehicleService;
    @GetMapping("findVehicleAndTtypeByName143")
    public Result findVehicleAndTtypeByName143(
            @RequestParam(value = "currentPage",required = false,defaultValue = "1") int currentPage,
            @RequestParam(value = "pageSize",required = false,defaultValue = "3") int pageSize,
            @RequestParam(value = "name",required = false,defaultValue = "")String name
    ){
        Page<Vehicle> vehicleAndTtypeByName = vehicleService.findVehicleAndTtypeByName(currentPage, pageSize, name);
        return Result.ok().data("pageinfo",vehicleAndTtypeByName);
    }

}

